Page({
    onReady() {
        const query = wx.createSelectorQuery()
        query.select('#myCanvas')
            .fields({ node: true, size: true })
            .exec((res) => {
                const canvas = res[0].node
                const ctx = canvas.getContext('2d')
                const dpr = wx.getSystemInfoSync().pixelRatio
                canvas.width = res[0].width * dpr
                canvas.height = res[0].height * dpr
                ctx.scale(dpr, dpr)

                let img=canvas.createImage()
                // console.log(img);return;
                img.src = "/images/zp.png"
                img.onload(res => {
                    ctx.drawImage(img, 0, 0, 100, 100)
                })
            })
    }
})